SET CAMERA TO IMAGE

  Syntax
SET CAMERA TO IMAGE Camera Number, Image Number, Width, Height
SET CAMERA TO IMAGE Camera Number, Image Number, Width, Height, Generate Alpha Mode
SET CAMERA TO IMAGE Camera Number, Image Number, Width, Height, Generate Alpha Mode, D3D Format
  Parameters
Camera Number
Integer
The camera number
Image Number
Integer
Direct all camera output to this specified image number
Width
Integer
Specify the width value
Height
Integer
Specify the height value
Generate Alpha Mode
Integer
Specifies the generate alpha mode. A value of zero or one will create a standard image, whereas a value of two will create an image using the DirectX format D3DFMT_A8R8G8B8. A value of three will allow you to specify an additional parameter with your own
D3D Format
Dword
Specifies the DirectX surface format when generate alpha mode three is used. Available modes can be found listed in the example below.

  Returns

This command does not return a value.

  Example Code
autocam on:backdrop on
make matrix 1,4000,4000,100,100
set matrix height 1,50,50,500
update matrix 1
make camera 1
position camera 1,0,500,500
point camera 1,2000,0,2000
set camera to image 1,1,128,128
fov=45:range=1000:size=0:aspect=screen width()/screen height()
point camera 0,2000,0,2000
while mouseclick()=0
paste image 1,0,0
set cursor 0,0
print "a-z Field-Of-View Angle ",fov
print "s-x viewing range of the camera ",range
print "d-c viewport of the camera ",size
print "f-v Aspect Ratio ",aspect
if inkey$()="a" then fov=fov-1:if fov<0 then fov=0
if inkey$()="z" then fov=fov+1
if inkey$()="s" then range=range-1:if range<0 then range=0
if inkey$()="x" then range=range+1
if inkey$()="d" then size=size-1:if size<0 then size=0
if inkey$()="c" then size=size+1
if inkey$()="f" then aspect=aspect-1:if aspect<0 then aspect=0
if inkey$()="v" then aspect=aspect+1
set camera fov 0,fov
set camera range 0,1,range
set camera view 0,size,size,screen width()-size,screen height()-size
set camera aspect 0,aspect
endwhile
while mouseclick()=1 : endwhile
delete matrix 1:autocam off:backdrop off
end

rem D3DFMT_UNKNOWN = 0
rem D3DFMT_R8G8B8 = 20
rem D3DFMT_A8R8G8B8 = 21
rem D3DFMT_X8R8G8B8 = 22
rem D3DFMT_R5G6B5 = 23
rem D3DFMT_X1R5G5B5 = 24
rem D3DFMT_A1R5G5B5 = 25
rem D3DFMT_A4R4G4B4 = 26
rem D3DFMT_R3G3B2 = 27
rem D3DFMT_A8 = 28
rem D3DFMT_A8R3G3B2 = 29
rem D3DFMT_X4R4G4B4 = 30
rem D3DFMT_A2B10G10R10 = 31
rem D3DFMT_A8B8G8R8 = 32
rem D3DFMT_X8B8G8R8 = 33
rem D3DFMT_G16R16 = 34
rem D3DFMT_A2R10G10B10 = 35
rem D3DFMT_A16B16G16R16 = 36
rem D3DFMT_A8P8 = 40
rem D3DFMT_P8 = 41
rem D3DFMT_L8 = 50
rem D3DFMT_A8L8 = 51
rem D3DFMT_A4L4 = 52
rem D3DFMT_V8U8 = 60
rem D3DFMT_L6V5U5 = 61
rem D3DFMT_X8L8V8U8 = 62
rem D3DFMT_Q8W8V8U8 = 63
rem D3DFMT_V16U16 = 64
rem D3DFMT_A2W10V10U10 = 67
rem D3DFMT_D16_LOCKABLE = 70
rem D3DFMT_D32 = 71
rem D3DFMT_D15S1 = 73
rem D3DFMT_D24S8 = 75
rem D3DFMT_D24X8 = 77
rem D3DFMT_D24X4S4 = 79
rem D3DFMT_D16 = 80
rem D3DFMT_D32F_LOCKABLE = 82
rem D3DFMT_D24FS8 = 83
rem D3DFMT_D32_LOCKABLE = 84
rem D3DFMT_S8_LOCKABLE = 85
rem D3DFMT_L16 = 81
rem D3DFMT_VERTEXDATA = 100
rem D3DFMT_INDEX16 = 101
rem D3DFMT_INDEX32 = 102
rem D3DFMT_Q16W16V16U16 = 110
rem D3DFMT_R16F = 111
rem D3DFMT_G16R16F = 112
rem D3DFMT_A16B16G16R16F = 113
rem D3DFMT_R32F = 114
rem D3DFMT_G32R32F = 115
rem D3DFMT_A32B32G32R32F = 116
rem D3DFMT_CxV8U8 = 117
rem D3DFMT_A1 = 118
rem D3DFMT_BINARYBUFFER = 199
  See also

CAMERA Commands Menu
Index